package day1016;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.Map;

@RestController
public class AController {

    @Autowired
    private Map<String, Animal> animalMap;

    @RequestMapping("test")
    public String test(String animal){
        Animal animal1 = animalMap.get(animal);
        animal1.run();
        return null;
    }

}
